package com.jack.vipmis.vip.api.web.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jack.vipmis.common.web.controller.BaseController;
import com.jack.vipmis.vip.api.util.MsgInfo;
import com.jack.vipmis.vip.jpush.entity.PushResources;
import com.jack.vipmis.vip.jpush.service.PushResourcesService;

/**
 * 推送消息Api
 * 
 * @author JackLiang
 * @version 1.0
 * @date 2014-7-15
 */
@Controller
@RequestMapping(value = "api/push")
public class PushMessageApiController extends BaseController<PushResources, Long> {

	@Autowired
	private PushResourcesService	pushResourcesService;

	/**
	 * 获取列表
	 * 
	 * @param text
	 *            搜索内容
	 * @return
	 */
	@RequestMapping(value = "list")
	@ResponseBody
	public Map<String, Object> list() {
		try {
			List<PushResources> result = pushResourcesService.list();
			return MsgInfo.ok(result);
		} catch (Exception e) {
			return MsgInfo.fail();
		}
	}

}
